#include<bits/stdc++.h>
using namespace std;

int countLatticePoints(vector<vector<int>> circles)
{
    int ans = 0;
    for(int i = 0;i <= 200;i++)
    {
        for(int j = 0;j <= 200;j++)
        {
            for(auto &ii:circles)
            {
                if((i-ii[0])*(i-ii[0]) + (j-ii[1])*(j-ii[1]) <= ii[2]*ii[2])
                {
                    ans++;
                    break;
                }
            }
        }
    }
    return ans;
}

int main()
{
	int x, y, z;
	vector<vector<int>> circles;
	while(cin>>x>>y>>z)
	{
		if(x == -1 && y == -1 && z == -1)
			break;
		circles.push_back({x, y, z});
	}
	int ans = countLatticePoints(circles);
	cout<<ans;
	return 0;
}

